package tools;

import java.util.Map;

public class DocumentEnumerator {
     private LuceneIndexReader lr;
     public DocumentEnumerator(LuceneIndexReader lr){
    	 this.lr = lr;
     }
     
     public void enumerate(int number){
    	 
    	 this.lr.queryEntityJSONIndex("Michael Jordan");//make lr initate name2id
    	 Map<String,Integer> name2id = this.lr.name2id;
    	 
    	 
    	 System.out.println("index size:"+name2id.size());
    	
    	 System.out.println("Clifton, Texas:"+name2id.containsKey("Clifton, Texas"));
    	 System.out.println("Medford (town), Wisconsin:"+name2id.containsKey("Medford (town), Wisconsin"));
    	 System.out.println("Aspen Daily News:"+name2id.containsKey("Aspen Daily News"));
    	 System.out.println("Becki Newton:"+name2id.containsKey("Becki Newton"));
    	 
    	 
    	 /*int i =0;
    	 for( String key: name2id.keySet()){
    		 
    		 if(i>number){
    			 break;
    		 }
    		 
    		 System.out.println("***********************************");
    		 System.out.println("Key:"+key);
    		 System.out.println("Json"+this.lr.queryEntityJSONIndex(key));
    		  
    		 i++;
    	 }*/
    	 
     }
     public static void main(String[] args){
    	 LuceneIndexReader lr = new LuceneIndexReader("/largedata1/cmput696/luceneIndex/lucene-e2d");
    	 DocumentEnumerator de = new DocumentEnumerator(lr);
    	 de.enumerate(10);
     }
     
}
